import request from '@/config/axios'

// 自研产品停产清单汇总 VO
export interface ProductSelfDiscontinuedVO {
  id: number // 序号
  productName: string // 产品名称
  productModel: string // 产品型号
  productVersion: string // 产品版本
  discontinuationReason: string // 停产原因
  discontinuationTime: Date // 停产时间
  notifier: string // 停产告知人
  remarks: string // 备注
}

// 自研产品停产清单汇总 API
export const ProductSelfDiscontinuedApi = {
  // 查询自研产品停产清单汇总分页
  getProductSelfDiscontinuedPage: async (params: any) => {
    return await request.get({ url: `/om/product-self-discontinued/page`, params })
  },

  // 查询自研产品停产清单汇总详情
  getProductSelfDiscontinued: async (id: number) => {
    return await request.get({ url: `/om/product-self-discontinued/get?id=` + id })
  },

  // 新增自研产品停产清单汇总
  createProductSelfDiscontinued: async (data: ProductSelfDiscontinuedVO) => {
    return await request.post({ url: `/om/product-self-discontinued/create`, data })
  },

  // 修改自研产品停产清单汇总
  updateProductSelfDiscontinued: async (data: ProductSelfDiscontinuedVO) => {
    return await request.put({ url: `/om/product-self-discontinued/update`, data })
  },

  // 删除自研产品停产清单汇总
  deleteProductSelfDiscontinued: async (id: number) => {
    return await request.delete({ url: `/om/product-self-discontinued/delete?id=` + id })
  },

  // 导出自研产品停产清单汇总 Excel
  exportProductSelfDiscontinued: async (params) => {
    return await request.download({ url: `/om/product-self-discontinued/export-excel`, params })
  },
}